package experiment_03;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class BIOClient {
  public static void main(String[] args)throws Exception{
	  Socket client =new Socket("localhost",12345);
	  InputStreamReader reader=new InputStreamReader(client.getInputStream());
	  BufferedReader br=new BufferedReader(reader);
	  PrintWriter writer=new PrintWriter(client.getOutputStream());
	  System.out.println("Server say:");
	  String readline="Hello!!!";
	  writer.println(readline);
	  writer.flush();
	  String response=br.readLine();
	  System.out.println("Server say:"+response);
	  writer.close();
	  br.close();
	  client.close();
  }
}
